﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Data.SqlTypes;


namespace table_select
{
    /// <summary>
    /// tablesel 的摘要说明
    /// </summary>
    public class tablesel
    {
        public static DataTable con_open(string strcmd)
        {
            string Constr;
            Constr = System.Configuration.ConfigurationManager.ConnectionStrings["Ling"].ConnectionString;
            SqlConnection con = new SqlConnection(Constr);
            con.Open();
            SqlCommand cmd = con.CreateCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = strcmd;
            DataTable dt = new DataTable();
            SqlDataAdapter sqlda = new SqlDataAdapter(cmd);
            sqlda.Fill(dt);
            return (dt);
        }


        public static void con_select(string strcmd)
        {
            string ConStr;
            ConStr = System.Configuration.ConfigurationManager.ConnectionStrings["Ling"].ConnectionString;
            SqlConnection con = new SqlConnection(ConStr);
            con.Open();
            SqlCommand cmd = con.CreateCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = strcmd;
            cmd.ExecuteNonQuery();




        }






        public tablesel()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
    }
}